%%This is a very basic article template.
%%There is just one section and two subsections.
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{fit,positioning,shapes}
\pagestyle{empty}
\begin{document}


\begin{tikzpicture}

\tikzstyle{box} = [
	draw,
	rectangle,
	inner sep=0pt,
	node distance=0pt,
	minimum height=20pt
]
\tikzstyle{box-2} = [
	inner sep=0pt,
	node distance=0pt,
	minimum height=20pt
]
\node[
	box,
	minimum width=20pt
](NL) {NL};
\node[
	box,
	right=50pt of NL,
	minimum width=80pt
](conceptual-query) {Conceptual query};
\path[->] (NL) edge node[above=0pt] {interface} (conceptual-query);
\node[
	box,
	right=60pt of conceptual-query,
	minimum width=80pt
](structured-query) {};
\node[
	below=-2pt of structured-query.north
](structured-query-label-1) {Structured query};
\node[
	above=-2pt of structured-query.south
](structured-query-label-2) {MyMDX};
\path[->](conceptual-query) edge node[above=0pt] {query}
(structured-query);
\path[ ](conceptual-query) edge node[below=0pt] {processor} (structured-query);
\node[
	box-2,
	below=35pt of structured-query
](query-executor) {};
\node[
	below=-2pt of query-executor.north
](query-executor-label-1) {Query};
\node[
	above=-2pt of query-executor.south
](query-executor-label-2) {executor};
\path[->](structured-query) edge (query-executor);
\node[
	box-2,
	below=45pt of query-executor
](clustering) {Clustering};
\path[->](query-executor) edge (clustering);
\node[
	box,
	below=25pt of clustering,
	minimum width=70pt
](user-model) {};
\node[
	below=-2pt of user-model.north
](user-model-label-1) {User's behavior};
\node[
	above=-2pt of user-model.south
](user-model-label-2) {model};
\path[->](clustering) edge (user-model);
\node[
	box,
	below=145pt of NL,
	minimum width=70pt
](predicted-query) {};
\node[
	below=-2pt of predicted-query.north
](predicted-query-label-1) {Predicted};
\node[
	above=-2pt of predicted-query.south
](predicted-query-label-2) {MyMDX query};
\path[->](user-model) edge(predicted-query);
\path[->](predicted-query) edge (NL);
\tikzstyle{ell} = [
	draw,
	ellipse,
	minimum width=40pt,
	minimum height=5pt,
	inner sep=0pt,
	node distance=0pt
]
\node[
	ell,
	below=20pt of conceptual-query,
	xshift=-40pt
](ellipse-1) {};
\node[
	ell,
	below=30pt of ellipse-1,
](ellipse-2) {};
\path[-] (ellipse-1.west) edge (ellipse-2.west);
\path[-] (ellipse-1.east) edge (ellipse-2.east);
\node[
	below=4pt of ellipse-1
](user-model-2-label-1) {User};
\node[
	above=4pt of ellipse-2
](user-model-2-label-2) {model};
\node[
	ell,
	right=20pt of ellipse-1
](ellipse-3) {};
\node[
	ell,
	below=30pt of ellipse-3
](ellipse-4) {};
\path[-](ellipse-3.west) edge (ellipse-4.west);
\path[-](ellipse-3.east) edge (ellipse-4.east);
\node[
	below=4pt of ellipse-3
](context-model-label-1) {Context};
\node[
	above=4pt of ellipse-4
](context-model-label-2) {model};
\node[
	fit=(ellipse-1)(ellipse-2)
](user-model-2) {};
\node[
	fit=(ellipse-3)(ellipse-4)
](context-model) {};
\node[
	draw,
	rectangle,
	fit=(user-model-2)(context-model)
](context-manager) {};
\node[
	below=0pt of context-manager
](context-manager-label) {Context manager};
\path[->](context-manager) edge (structured-query);
\node[
	ell,
	minimum width=50pt,
	below=25pt of context-manager,
	xshift=20pt
](ellipse-5) {};
\node[
	ell,
	minimum width=50pt,
	below=30pt of ellipse-5
](ellipse-6) {};
\path[-](ellipse-5.west) edge (ellipse-6.west);
\path[-](ellipse-5.east) edge (ellipse-6.east);
\node[
	fit=(ellipse-5)(ellipse-6)
](prediction-model) {};
\node[
	below=4pt of ellipse-5
](prediction-model-label-1) {Prediction};
\node[
	above=4pt of ellipse-6
](prediction-model-label-2) {model};
\node[
	ell,
	right=20pt of ellipse-5
](ellipse-7) {};
\node[
	ell,
	below=30pt of ellipse-7
](ellipse-8) {};
\path[-](ellipse-7.west) edge (ellipse-8.west);
\path[-](ellipse-7.east) edge (ellipse-8.east);
\node[
	fit=(ellipse-7)(ellipse-8)
](learning-module) {};
\node[
	below=4pt of ellipse-7
](learning-module-label-1) {Learning};
\node[
	above=4pt of ellipse-8
](learning-module-label-2) {module};
\node[
	above=30pt of learning-module
] (history) {History};
\path[->](history) edge (learning-module);
\node[
	fit=(prediction-model)(learning-module),
	draw,
	rectangle
](unknown) {};
\path[->](learning-module) edge (clustering);
\node[
	below=30pt of prediction-model
](prediction) {Prediction};
\path[->](prediction-model) edge (prediction);
\end{tikzpicture}


\end{document}
